$.fn.basicTabSetIdx = function(a) {
    var c, d, e, f, g, h, b = $(this);
    if (1 == b.attr("iframeMode") || "true" == b.attr("iframeMode")) {
        if (d = b.find("a").eq(a), e = b.data("data"), !e) return;
        f = "list", b.attr("dataRoot") && (f = b.attr("dataRoot")), g = e[f] ? e[f] : e, 
        c = g.length, h = b.find(".basicTab_con").eq(0).find("iframe").eq(0), h.attr("src", g[a].url), 
        d.prevAll("a").find("li").removeClass("basicTab_current_center"), d.nextAll("a").find("li").removeClass("basicTab_current_center"), 
        d.find("li").addClass("basicTab_current_center");
    } else d = b.find(".basicTab_normal_center").eq(a), c = b.find(".basicTab_con").length, 
    b.find(".basicTab_con").hide(), b.find(".basicTab_con").eq(a).fadeIn(), d.prevAll("li").removeClass("basicTab_current_center"), 
    d.nextAll("li").removeClass("basicTab_current_center"), d.addClass("basicTab_current_center");
    d.prevAll("li").removeClass("basicTab_current_left"), d.prevAll("li").removeClass("basicTab_current_middle"), 
    d.prevAll("li").removeClass("basicTab_current_middle2"), d.prevAll("li").removeClass("basicTab_current_right"), 
    d.nextAll("li").removeClass("basicTab_current_left"), d.nextAll("li").removeClass("basicTab_current_middle"), 
    d.nextAll("li").removeClass("basicTab_current_middle2"), d.nextAll("li").removeClass("basicTab_current_right"), 
    0 == a ? (d.prev().addClass("basicTab_current_left"), d.next().addClass("basicTab_current_middle")) : a == c - 1 ? (d.prev().addClass("basicTab_current_middle2"), 
    d.next().addClass("basicTab_current_right")) : (d.prev().addClass("basicTab_current_middle2"), 
    d.next().addClass("basicTab_current_middle")), b.trigger("actived", a), b.attr("selectedIdx", a);
}, $.fn.basicTabSetEnable = function(a, b) {
    var d, e, f, g, h, c = $(this);
    if (1 == c.attr("iframeMode") || "true" == c.attr("iframeMode")) {
        if (f = c.data("data"), !f) return;
        g = "list", c.attr("dataRoot") && (g = c.attr("dataRoot")), h = f[g] ? f[g] : f, 
        d = h.length, e = c.find("a").eq(a), 1 == b ? (e.find("li").removeClass("disabled"), 
        e.bideClickIframe(!0, c, a, d), e.hover(function() {
            $(this).find("li").addClass("basicTab_hover_center");
        }, function() {
            $(this).find("li").removeClass("basicTab_hover_center");
        })) : (e.find("li").addClass("disabled"), e.bideClickIframe(!1, c, a, d), e.unbind("hover"));
    } else d = c.find(".basicTab_con").length, e = c.find(".basicTab_normal_center").eq(a), 
    1 == b ? (e.removeClass("disabled"), e.bideClick(!0, c, a, d), e.hover(function() {
        $(this).addClass("basicTab_hover_center");
    }, function() {
        $(this).removeClass("basicTab_hover_center");
    })) : (e.addClass("disabled"), e.bideClick(!1, c, a, d), e.unbind("hover"));
}, $.fn.basicTabRender = function() {
    function x(a) {
        var b, j;
        a && (b = a[p] ? a[p] : a, i = b.length, j = "", "none" == h.attr("startSlection") && (j = "none"), 
        $.each(b, function(a, b) {
            var p, q, r, s, t, u, o = uncompile(quiLanguage.basicTab.tabName);
            b.name && (o = b.name), k == a && b.url && n.attr("src", b.url), 0 == a && (p = $('<li class="basicTab_normal_left"></li>'), 
            d.append(p), k == a && "none" != j && p.addClass("basicTab_current_left"), setTimeout(function() {
                c += p.outerWidth();
            }, 500)), q = $('<li class="basicTab_normal_center"></li>'), r = $("<a></a>"), null != b.url && r.attr("href", b.url), 
            null != m && r.attr("target", m), q.text(o), r.append(q), d.append(r), l || q.addClass("disabled"), 
            s = !0, b.itemDisabled && ("true" == b.itemDisabled || 1 == b.itemDisabled) && (q.addClass("disabled"), 
            s = !1), q.data("idx", a), k == a && "none" != j && q.addClass("basicTab_current_center"), 
            a == i - 1 ? (t = $('<li class="basicTab_normal_right"></li>'), d.append(t), k == a && "none" != j && t.addClass("basicTab_current_right"), 
            ("true" == h.attr("tabScroll") || 1 == h.attr("tabScroll")) && setTimeout(function() {
                c = c + q.outerWidth() + t.outerWidth(), g = h.outerWidth(), c > g && (d.css("left", 18), 
                e.fadeIn(200), f.fadeIn(200));
            }, 500)) : (u = $('<li class="basicTab_normal_middle"></li>'), d.append(u), k == a && "none" != j ? u.addClass("basicTab_current_middle") : k == a + 1 && "none" != j && u.addClass("basicTab_current_middle2"), 
            setTimeout(function() {
                c = c + q.outerWidth() + u.outerWidth(), g = h.outerWidth(), c > g && (d.css("left", 18), 
                e.fadeIn(200), f.fadeIn(200));
            }, 500)), l && s ? (r.bideClickIframe(!0, h, a, i), r.hover(function() {
                $(this).find("li").addClass("basicTab_hover_center");
            }, function() {
                $(this).find("li").removeClass("basicTab_hover_center");
            })) : (r.bideClickIframe(!1, h, a, i), r.unbind("hover"));
        }));
    }
    var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, t, u, v, w;
    if ($(this).find(".basicTab_top").remove(), a = 2, c = 0, g = 0, h = $(this), j = $('<div class="basicTab_top"></div>'), 
    "true" == h.attr("tabScroll") || 1 == h.attr("tabScroll") ? (d = $('<div class="basicTab_top_Container"></div>'), 
    e = $('<div class="basicTab_tabButtonLeft" style="display:none;"></div>'), f = $('<div class="basicTab_tabButtonRight" style="display:none;"></div>'), 
    j.append(d), j.append(e), j.append(f), g = j.width(), $(window).bind("resize", function() {
        g = j.width(), c > g && (a = 18, d.css("left", a), e.fadeIn(200), f.fadeIn(200)), 
        g > c + 8 && (a = 0, d.css("left", a), e.fadeOut(200), f.fadeOut(200));
    }), e.bind("mousedown", function() {
        g = j.width(), b = setInterval(function() {
            return a > 18 ? (a = 18, clearInterval(b), void 0) : (a += 8, d.css("left", a), 
            void 0);
        }, 30);
    }), e.bind("mouseup", function() {
        clearInterval(b);
    }), f.bind("mousedown", function() {
        g = j.width(), b = setInterval(function() {
            return a > 18 ? (a = 18, clearInterval(b), void 0) : g - c > a ? (a = g - c, clearInterval(b), 
            void 0) : (a -= 8, d.css("left", a), void 0);
        }, 30);
    }), f.bind("mouseup", function() {
        clearInterval(b);
    })) : d = j, k = 0, h.attr("selectedIdx") ? k = Number(h.attr("selectedIdx")) : h.attr("selectedIdx", 0), 
    l = !0, (1 == h.attr("allItemDisabled") || "true" == h.attr("allItemDisabled")) && (l = !1), 
    m = null, o = !1, (1 == h.attr("showProgress") || "true" == h.attr("showProgress")) && (o = !0), 
    1 == h.attr("iframeMode") || "true" == h.attr("iframeMode") || 1 == h.attr("singleContentMode") || "true" == h.attr("singleContentMode")) {
        if (h.find(">div").length > 1 && alert(uncompile(quiLanguage.basicTab.errorMessage)), 
        h.find(">div").addClass("basicTab_con"), h.find(">div").css({
            overflowX: "hidden",
            overflowY: "auto"
        }), n = h.find(">div").eq(0).find("iframe").eq(0), n.attr("name") && (m = n.attr("name")), 
        p = "list", h.attr("dataRoot") && (p = h.attr("dataRoot")), q = h.attr("params")) try {
            r = JSON.parse(q);
        } catch (s) {
            r = "", alert(uncompile(quiLanguage.basicTab.paramErrorMessage));
        } else r = "";
        if (t = "", u = h.attr("url"), v = h.attr("data"), w = h.data("data")) x(w); else if (v) {
            try {
                t = JSON.parse(v);
            } catch (s) {
                t = "", alert(uncompile(quiLanguage.basicTab.dataErrorMessage));
            }
            h.data("data", t), x(t);
        } else u && $.ajax({
            url: h.attr("url"),
            dataType: "json",
            data: r,
            error: function() {
                alert(uncompile(quiLanguage.basicTab.urlErrorMessage));
            },
            success: function(a) {
                h.data("data", a), t = a, x(a);
            }
        });
    } else i = h.find(">div").length, h.find(">div").each(function(a) {
        var j, m, n, o, p, b = uncompile(quiLanguage.basicTab.tabName);
        $(this).attr("name") && (b = $(this).attr("name")), $(this).addClass("basicTab_con"), 
        k != a && $(this).hide(), 0 == a && (j = $('<li class="basicTab_normal_left"></li>'), 
        d.append(j), k == a && j.addClass("basicTab_current_left"), ("true" == h.attr("tabScroll") || 1 == h.attr("tabScroll")) && setTimeout(function() {
            c += j.outerWidth();
        }, 500)), m = $('<li class="basicTab_normal_center"></li>'), d.append(m), m.text(b), 
        m.data("idx", a), l || m.addClass("disabled"), n = !0, ("true" == $(this).attr("itemDisabled") || 1 == $(this).attr("itemDisabled")) && (m.addClass("disabled"), 
        n = !1), k == a && m.addClass("basicTab_current_center"), a == i - 1 ? (o = $('<li class="basicTab_normal_right"></li>'), 
        d.append(o), k == a && o.addClass("basicTab_current_right"), ("true" == h.attr("tabScroll") || 1 == h.attr("tabScroll")) && setTimeout(function() {
            c = c + m.outerWidth() + o.outerWidth(), g = h.outerWidth(), c > g && (d.css("left", 18), 
            e.fadeIn(200), f.fadeIn(200));
        }, 500)) : (p = $('<li class="basicTab_normal_middle"></li>'), d.append(p), k == a ? p.addClass("basicTab_current_middle") : k == a + 1 && p.addClass("basicTab_current_middle2"), 
        ("true" == h.attr("tabScroll") || 1 == h.attr("tabScroll")) && setTimeout(function() {
            c = c + m.outerWidth() + p.outerWidth(), g = h.outerWidth(), c > g && (d.css("left", 18), 
            e.fadeIn(200), f.fadeIn(200));
        }, 500)), l && n && (1 == h.attr("hoverMode") || "true" == h.attr("hoverMode") ? m.bideOver(!0, h, a, i) : (m.bideClick(!0, h, a, i), 
        m.hover(function() {
            $(this).addClass("basicTab_hover_center");
        }, function() {
            $(this).removeClass("basicTab_hover_center");
        })));
    });
    d.append($('<div class="clear"></div>')), h.prepend(j);
}, $.fn.bideClick = function(a, b, c, d) {
    var e = $(this);
    e.unbind("click"), a && e.bind("click", {}, function() {
        b.find(".basicTab_con").hide(), b.find(".basicTab_con").eq(c).fadeIn(), $(this).prevAll("li").removeClass("basicTab_current_left"), 
        $(this).prevAll("li").removeClass("basicTab_current_center"), $(this).prevAll("li").removeClass("basicTab_current_middle"), 
        $(this).prevAll("li").removeClass("basicTab_current_middle2"), $(this).prevAll("li").removeClass("basicTab_current_right"), 
        $(this).nextAll("li").removeClass("basicTab_current_left"), $(this).nextAll("li").removeClass("basicTab_current_center"), 
        $(this).nextAll("li").removeClass("basicTab_current_middle"), $(this).nextAll("li").removeClass("basicTab_current_middle2"), 
        $(this).nextAll("li").removeClass("basicTab_current_right"), $(this).addClass("basicTab_current_center"), 
        0 == c ? ($(this).prev().addClass("basicTab_current_left"), $(this).next().addClass("basicTab_current_middle")) : c == d - 1 ? ($(this).prev().addClass("basicTab_current_middle2"), 
        $(this).next().addClass("basicTab_current_right")) : ($(this).prev().addClass("basicTab_current_middle2"), 
        $(this).next().addClass("basicTab_current_middle")), b.trigger("actived", c), b.attr("selectedIdx", c);
    });
}, $.fn.bideOver = function(a, b, c, d) {
    var e = $(this);
    e.unbind("mouseover"), a && e.bind("mouseover", {}, function() {
        b.find(".basicTab_con").hide(), b.find(".basicTab_con").eq(c).fadeIn(), $(this).prevAll("li").removeClass("basicTab_current_left"), 
        $(this).prevAll("li").removeClass("basicTab_current_center"), $(this).prevAll("li").removeClass("basicTab_current_middle"), 
        $(this).prevAll("li").removeClass("basicTab_current_middle2"), $(this).prevAll("li").removeClass("basicTab_current_right"), 
        $(this).nextAll("li").removeClass("basicTab_current_left"), $(this).nextAll("li").removeClass("basicTab_current_center"), 
        $(this).nextAll("li").removeClass("basicTab_current_middle"), $(this).nextAll("li").removeClass("basicTab_current_middle2"), 
        $(this).nextAll("li").removeClass("basicTab_current_right"), $(this).addClass("basicTab_current_center"), 
        0 == c ? ($(this).prev().addClass("basicTab_current_left"), $(this).next().addClass("basicTab_current_middle")) : c == d - 1 ? ($(this).prev().addClass("basicTab_current_middle2"), 
        $(this).next().addClass("basicTab_current_right")) : ($(this).prev().addClass("basicTab_current_middle2"), 
        $(this).next().addClass("basicTab_current_middle")), b.trigger("actived", c), b.attr("selectedIdx", c);
    });
}, $.fn.bideClickIframe = function(a, b, c, d) {
    var e = $(this);
    e.unbind("click"), a ? e.bind("click", {}, function() {
        if ($(this).prevAll("li").removeClass("basicTab_current_left"), $(this).prevAll("li").removeClass("basicTab_current_middle"), 
        $(this).prevAll("li").removeClass("basicTab_current_middle2"), $(this).prevAll("li").removeClass("basicTab_current_right"), 
        $(this).prevAll("a").find("li").removeClass("basicTab_current_center"), $(this).nextAll("li").removeClass("basicTab_current_left"), 
        $(this).nextAll("li").removeClass("basicTab_current_middle"), $(this).nextAll("li").removeClass("basicTab_current_middle2"), 
        $(this).nextAll("li").removeClass("basicTab_current_right"), $(this).nextAll("a").find("li").removeClass("basicTab_current_center"), 
        $(this).find("li").addClass("basicTab_current_center"), 0 == c ? ($(this).prev().addClass("basicTab_current_left"), 
        $(this).next().addClass("basicTab_current_middle")) : c == d - 1 ? ($(this).prev().addClass("basicTab_current_middle2"), 
        $(this).next().addClass("basicTab_current_right")) : ($(this).prev().addClass("basicTab_current_middle2"), 
        $(this).next().addClass("basicTab_current_middle")), "true" == b.attr("showProgress") || 1 == b.attr("showProgress")) try {
            showProgressBar();
        } catch (a) {}
        b.trigger("actived", c), b.attr("selectedIdx", c);
    }) : e.bind("click", {}, function() {
        return !1;
    });
};